import pandas as pd

# 构建一个序列，指定数据和索引
series = pd.Series(data=[1, 2, 3, 4, 5, 6], index=["a", "b", "c", "d", "e", "f"])
print(series)

# 修改索引
series.index = [0, 1, 2, 3, 4, 5]

print(series)

# 通过字典构建
di = dict(a=1, b=2, c=3)
print(di)
pd_series = pd.Series(di)
print(pd_series)

# 构建DataFrame

users = {
    "name": ["张三", "李四", "王五"],
    "age": [23, 24, 25]
}
print(users)

df = pd.DataFrame(users)
print(df)


